<template>
	<div :class="type == 'Header_style46_diytitle' || (type != 'Header_style46_diytitle' && tplItemData.mainTitleStyle == 1) ? 'tpl37-title':'tpl31-title'"
    :style="tplItemData.modulePadding || tplItemData.modulePadding ==0?'padding-top:'+tplItemData.modulePadding+'px;padding-bottom:'+tplItemData.modulePadding+'px;':'padding-top:5px;padding-bottom:5px;'">
    <div class="title-box" v-if="type == 'Header_style46_diytitle' || (type != 'Header_style46_diytitle' && tplItemData.mainTitleStyle == 1) ">
      <h2 class="title">{{tplItemData.title}}</h2>
    </div>
    <div class="title-box" :class="tplItemData.fontSize" v-else>
        <h2 class="title">{{tplItemData.title}} <span class="subtitle" style="color: #999"  v-if="type == 'Header_style33_diytitle' || tplItemData.mainTitleStyle == 3">{{tplItemData.subtitle}}</span></h2>
        <h3 class="subtitle" :class="type == 'Header_style9_diytitle' ? 'style9_diytitle' : ''" v-if="type != 'Header_style33_diytitle' && tplItemData.mainTitleStyle == 2">{{tplItemData.subtitle}}</h3>
    </div>
  </div>
</template>

<script>
import Vue from 'vue'
import { NoticeBar } from 'vant'

Vue.use(NoticeBar)
export default Vue.extend({
  name: 'index',
  components: {
  },
  props: {
    tplItemData: {
      type: Object,
      default() {
        return {}
      }
    },
    type: {
      type: String
    }
  },
  created() {
    // // console.log(this.tplItemData)
  }
})
</script>

<style lang="scss">
.tpl31-title{
  .title,.subtitle{
    font-size: 28px;
    color: #000;
  }
  .subtitle {
    line-height: 40px;
  }
}
.style9_diytitle {
  font-size: 24px!important;
  color: #999!important;
}
.tpl37-title{
  .title-box{
    padding: 20px 0;
    text-align: center;
    background: url("https://img.wifenxiao.com/h5-wfx/images/diy/tpl37/title_bg.png") center no-repeat;
    background-size: 100%;
    .title{
      color: #1a1a1a;
      font-size: 32px;
      line-height: 48px;
    }
  } 
}
</style>
